// 应收账单列表
import expandRow from './table-expand.vue'
export const AccountsReceivableThead = [
  // {
  //   type: 'selection',
  //   minWidth: 60,
  //   align: 'center'
  // },
  {
    title: '费用月份',
    key: 'periodMonth',
    minWidth: 100,
    render: (h, params) => {
      const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
      const text = params.row.periodYear + '' + month
      return h('span', text)
    }
  },
  {
    title: '客户名称',
    key: 'companyName',
    minWidth: 240
  },
  {
    title: '发票状态',
    key: 'invoiceStatus',
    minWidth: 150,
    render: (h, params) => {
      const text = params.row.invoiceStatus === 0 ? '未开具' : '已开具'
      return h('span', text)
    }
  },
  {
    title: '应到总计',
    key: 'shouldArriveTotal',
    minWidth: 150
  },
  {
    title: '实到总计',
    key: 'trueArriveTotal',
    minWidth: 150
  },
  {
    title: '当期差额总计',
    key: 'currentBalanceTotal',
    minWidth: 150
  },
  {
    title: '累计差额总计',
    key: 'allBalanceTotal',
    minWidth: 150
  },
  {
    title: '所属客服',
    key: 'serverName',
    minWidth: 150
  },
  {
    title: '操作',
    key: 'action',
    slot: 'action',
    fixed: 'right',
    minWidth: 400
  },
  {
    title: '展开',
    type: 'expand',
    key: 'expand',
    // slot: 'action',
    fixed: 'right',
    minWidth: 70,
    render: (h, params) => {
      return h(expandRow, {
        props: {
          row: params.row
        }
      })
    }
  }
]

// 展开详情
export const ChildrenThead = [
  {
    title: '费用项目名称',
    key: 'insuranceName',
    tooltip: true
  },
  {
    title: '应到总计',
    key: 'shouldArriveTotal',
    tooltip: true
  },
  {
    title: '实到总计',
    key: 'trueArriveTotal',
    tooltip: true
  },
  {
    title: '当期差额总计',
    key: 'currentBalanceTotal',
    tooltip: true
  },
  {
    title: '累计差额总计',
    key: 'allBalanceTotal',
    tooltip: true
  }
]

// 实到明细列表
export const ActualArrivalThead = [
  {
    title: '费用月份',
    key: 'feeDate',
    minWidth: 150
    // render: (h, params) => {
    //   const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
    //   const text = params.row.periodYear + '-' + month
    //   return h('span', text)
    // }
  },
  {
    title: '客户名称',
    key: 'customerName',
    minWidth: 200
  },
  {
    title: '到款日期',
    key: 'receiveDate',
    minWidth: 150,
    render: (h, params) => {
      const text = params.row.receiveDate ? params.row.receiveDate.slice(0, 10) : ''
      return h('span', text)
    }
  },
  {
    title: '到款银行',
    key: 'bankName',
    minWidth: 150
  },
  {
    title: '到款金额',
    key: 'trueArriveTotal',
    minWidth: 150
  }
]

// 应到明细列表
export const ShouldArrivalThead = [
  {
    title: '费用月份',
    key: 'periodMonth',
    minWidth: 150,
    render: (h, params) => {
      const month = params.row.periodMonth < 10 ? '0' + params.row.periodMonth : params.row.periodMonth
      const text = params.row.periodYear + '' + month
      return h('span', text)
    }
  },
  {
    title: '客户名称',
    key: 'companyName',
    minWidth: 150
  },
  {
    title: '客户编码',
    key: 'companyCode',
    minWidth: 150
  },
  {
    title: '养老应到',
    key: 'pension',
    minWidth: 150
  },
  {
    title: '医疗应到',
    key: 'medicalCare',
    minWidth: 150
  },
  {
    title: '失业应到',
    key: 'unemployment',
    minWidth: 150
  },
  {
    title: '工伤应到',
    key: 'injuryOnTheJob',
    minWidth: 150
  },
  {
    title: '生育应到',
    key: 'birth',
    minWidth: 150
  },
  {
    title: '大病应到',
    key: 'seriousIllness',
    minWidth: 150
  },
  {
    title: '残保金应到',
    key: 'disabledPersonsSecurityFund',
    minWidth: 150
  },
  {
    title: '门诊医疗应到',
    key: 'outpatientDepartment',
    minWidth: 150
  },
  {
    title: '公积金应到',
    key: 'providentFund',
    minWidth: 150
  },
  {
    title: '商保应到',
    key: 'commercial',
    minWidth: 150
  },
  {
    title: '工资应到',
    key: 'salary',
    minWidth: 150
  },
  {
    title: '个税应到',
    key: 'tax',
    minWidth: 150
  },
  {
    title: '手续费应到',
    key: 'fee',
    minWidth: 150
  },
  {
    title: '服务费应到',
    key: 'serviceFee',
    minWidth: 150
  },
  {
    title: '应到总计',
    key: 'total',
    minWidth: 150
  },
  {
    title: '所属客服',
    key: 'serverName',
    minWidth: 150
  }
]

// 差额处理弹窗
export const BalanceProcessModalThead = [
  {
    title: '差额所属项目',
    key: 'insuranceName',
    tooltip: true,
    minWidth: 100
  },
  {
    title: '差额所属编号',
    key: 'insureNo',
    tooltip: true,
    minWidth: 100
  },
  {
    title: '当期差额',
    key: 'total',
    tooltip: true,
    minWidth: 100
  },
  {
    title: '差额说明',
    key: 'remark',
    tooltip: true,
    minWidth: 120
  },
  {
    title: '操作',
    key: 'action',
    slot: 'action',
    minWidth: 80
  }
]

// 应收差额说明
export const receivableBalanceThead = [
  {
    title: '费用月份',
    key: 'periodMonth',
    minWidth: 150,
    render: (h, params) => {
      const month = params.row.month < 10 ? '0' + params.row.month : params.row.month
      const text = params.row.year + '' + month
      return h('span', text)
    }
  },
  {
    title: '客户名称',
    key: 'companyName',
    minWidth: 150
  },
  {
    title: '差额所属项目',
    key: 'insuranceName',
    minWidth: 150
  },
  {
    title: '差额所属编号',
    key: 'insureNo',
    minWidth: 150
  },
  {
    title: '当期差额',
    key: 'total',
    minWidth: 150
  },
  {
    title: '差额说明',
    key: 'remark',
    minWidth: 150
  }
]
